-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Remove scala.internal.quoted.LiftedExpr #6793
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
8925d6f
to
0609c54
Compare
4b86e2c
to
17675b7
Compare
Use reflection to implement `Liftable` for primitive types.
17675b7
to
65901c5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise, LGTM
@@ -1454,6 +1480,9 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util. | |||
def matchConstant_ClassTag(x: Constant): Option[Type] = | |||
if (x.tag == Constants.ClazzTag) Some(x.typeValue) else None | |||
|
|||
def Constant_apply(x: Unit | Null | Int | Boolean | Byte | Short | Int | Long | Float | Double | Char | String | Type): Constant = | |||
Constants.Constant(x) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why Type
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is the encoding for a classOf[T]
case _: String => liftedValue(value, "Liftable_String_delegate".toTermName, qctx) | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still need special compiler support for lifting primitives? Or it's for backward-compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not need it anymore.
@@ -64,6 +64,8 @@ trait TypeOrBoundsOps extends Core { | |||
|
|||
object Type { | |||
|
|||
def apply(clazz: Class[_])(implicit ctx: Context): Type = kernel.Type_apply(clazz) | |||
|
|||
object IsConstantType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the two neg-with-compiler tests are disabled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those tests where testing scope extrusion detection through an euristic which happens to no work anymore. I will work on more reliable mechanism for scope extrusion detection later.
Liftable
for primitive typesLiftable[Byte]
Expr.nullExpr
andExpr.unitExpr
to lift those values without pickling